import Vue from 'vue'
import VueRouter from 'vue-router'
import ShowGoods from '../views/showGoods'
import Header from '../views/header'



Vue.use(VueRouter)

const routes = [
  {
    // 可选params参数，不允许有参数，值为空
    // 要么有参数,参数有值，要么没有参数
    path: "/header",
    name: "Header",
    component: Header,
  },
  {
    // 可选params参数，不允许有参数，值为空
    // 要么有参数,参数有值，要么没有参数
    path: "/showGoods/:keyword?",
    name: "ShowGoods",
    component: ShowGoods,
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
